package com.czxy.Test;

import com.czxy.domain.Person;
import com.czxy.domain.PersonVo;
import com.czxy.service.PersonService;
import com.czxy.utils.MyUtils;

import java.text.ParseException;
import java.util.Date;
import java.util.List;

public class demo03 {
    public static void main(String[] args) throws ParseException {


        m09();

    }


    public static void m09() throws ParseException {

        PersonService personService = new PersonService();

        Person person = new Person();


        person.setAddress("上海");
        person.setSex("男");
        List<Person> list = personService.findPersonInfo(person);

        for (Person p : list) {

            System.out.println(p);
        }


    }

















    public static void m08() throws ParseException {

        PersonService personService = new PersonService();
        PersonVo vo = new PersonVo();

        vo.setStartTime(MyUtils.getDate("1999-12-12"));
        vo.setEndTime(MyUtils.getDate("2022-10-10"));
        Person pe = new Person();
        pe.setSex("女");
//        vo.setPerson(pe);

        List<Person> list = personService.findPVo(vo);
        for (Person p : list) {

            System.out.println(p);
        }


    }












    public static void m07() {


        PersonService personService = new PersonService();
        Person person = new Person();
        person.setSex("'男' or 1=1" );
        List<Person> list = personService.findSex(person);

        for (Person p : list) {
            System.out.println(p);
        }


    }

    public static void m06() {


        PersonService personService = new PersonService();

        personService.delById(4);



    }

    public static void m05() {


        PersonService personService = new PersonService();

        Person p = new Person();
        p.setSex("女");
        personService.del(p);



    }

    public static void m04() {


        PersonService personService = new PersonService();


        personService.update(new Person(null,"思",null,"女","北京"));
    }



    public  static  void  m03(){


        PersonService personService = new PersonService();

        personService.add(new Person(null, "???", new Date(), "男", "武汉"));




    }

    public  static  void  m02(){


        PersonService personService = new PersonService();

        List<Person> list = personService.findAll();

        for (Person p : list) {
            System.out.println(p);
        }
    }

    public  static  void  m01(){

        PersonService personService = new PersonService();
        List<Person> list = personService.findPersonByUid(1);
        for (Person p : list) {

            System.out.println(p);
        }


    }
}
